package com.lims.exception;

import com.lims.common.ResultCode;
import lombok.Data;

/**
 * @author limaosheng
 * @create 11:59 2021/9/2
 * @desc 事件自定义异常
 */
@Data
public class BaseException extends RuntimeException {

    private Integer code;
    private String message;

    public BaseException(ResultCode e) {
        this.code = e.getCode();
        this.message = e.getMsg();
    }

    public BaseException(ResultCode e, String msg) {
        this.code = e.getCode();
        this.message = msg;
    }

    public BaseException(String msg) {
        this.code = ResultCode.COMM_ERROR.getCode();
        this.message = msg;
    }
}
